import React, {Component} from 'react';
import KSwiper from "./component/KSwiper";
import KSwiperItem from "./component/KSwiperItem";

class App extends Component {
    state = {
        list: ["https://pic.maizuo.com/usr/movie/0c96c02cbd14bf817ed8271d081ea49e.jpg",
            "https://pic.maizuo.com/usr/movie/2fc6b93bc955d88a74ba339928ab485c.jpeg",
            "https://pic.maizuo.com/usr/movie/b6de4e5bf8f45e987a4d92d60e9d6f2b.jpg"]
    }

    render() {
        return (<div>
            <KSwiper loop={true} style={{height: "600px", width: "400px"}}>
                {
                    this.state.list.map((item, index) =>
                        // key必须写在外面 不能写在KSwiperItem组件内部 不知道咋回事
                        <KSwiperItem key={index}>
                            <img src={item} alt="" style={{width: "100%"}}/>
                        </KSwiperItem>
                    )
                }
            </KSwiper>
        </div>);
    }
}

export default App;